package component.fulltextsearch.util;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.PerFieldAnalyzerWrapper;
import org.apache.lucene.analysis.cn.ChineseAnalyzer;

import component.fulltextsearch.constant.SearchConstant;
import component.fulltextsearch.index.CharStopAnalyzer;

public abstract class AnalyzerUtil {
	public static Analyzer getAnalyzer() {
		PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new ChineseAnalyzer());
		analyzer.addAnalyzer(SearchConstant.NAME_RIGHTROLES, new CharStopAnalyzer());
		analyzer.addAnalyzer(SearchConstant.NAME_RIGHTUSERS, new CharStopAnalyzer());
		return analyzer;
	}
}
